#include <stdio.h>

int findPoisonedDuration(int* timeSeries, int timeSeriesSize, int duration)
{
    int count = 0;
    for(int i = 0;i < timeSeriesSize;i++)
    {
        if(timeSeries[i] + 1 != timeSeries[i+1])
        {
            count += 2;
        }
        else
        {
            count++;
        }
    }
    return count;
}


int main()
{
    int timeSeries[] = {1,2,4};
    int timeSeriesSize = sizeof(timeSeries)/sizeof(timeSeries[0]);
    int duration = 2;

    int num = findPoisonedDuration(timeSeries,timeSeriesSize ,duration);
    printf("%d\n",num);

    return 0;
}